package com.usooft.metaTalent.admin.system;

import com.usooft.framework.web.session.LoginSession;
import com.usooft.metaTalent.core.system.entity.Employee;
import lombok.RequiredArgsConstructor;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/logout")
@RequiredArgsConstructor
public class LogoutController {

    private final LoginSession loginSession;

    @PostMapping
    public ResponseEntity<?> logout(Employee employee) {
        loginSession.remove();

        return ResponseEntity.ok().build();
    }

}
